package com.lau.lambda;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by liutf on 2016/7/6.
 */
public class LambdaTest {

    public static void test(){
        List<String> list = Arrays.asList("aaaa", "bbbb", "cccc", "dddd", "eeee", "ffff");

        list.forEach(x -> System.out.println(x));

        List<String> collect = list.stream().map(str -> {
            return str.toUpperCase();
        }).collect(Collectors.toList());
        collect.forEach(System.out::print);

        List<String> collect1 = list.stream().map(String :: toUpperCase).collect(Collectors.toList());
        collect1.forEach(System.out::print);

    }





    public static void main(String[] args) {
        LambdaTest.test();
    }

}
